import piclib
from airtest.core.api import *
import normal
import cv2
import matplotlib.pyplot as plt
import piclib

conect_phone = True
pic_shot = 'pic/test.png'
if conect_phone:
    init_device('Android', '872QEEUG2255G')
    print('连接成功')
    print('手机分辨率：', normal.run_system_command('adb shell wm size'))
    snapshot(pic_shot)
pic_origin = cv2.imread(pic_shot)
print('图片尺寸：', pic_origin.shape, sep='')
pic_resized = cv2.resize(pic_origin, (1080, 2160))
pic_cut = pic_resized[255:416, 44:1045]
cv2.imwrite('pic\\qq_unexpect.png',pic_cut)


# plt.show()
# cut=piclib.pic_cut(pic_shot,[66, 100,360,200 ])
# cut.save('pic/test_cut.png')
